<?php
	session_start();
	include 'db.php';
	include 'inc/header.php';
	include 'inc/identifyCustomer.inc.php';
	
	if(!isset($_SESSION['salesName'])){
		header("location:saleslogin.php");
	}

?>

<!DOCTYPE HTML>
<html>
    <head>
    <meta charset=utf-8>
    <title>LEDLAMPS</title>
    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <script src="js/modernizr-1.7.min.js"></script><!-- this is the javascript allowing html5 to run in older browsers -->
    
    <link rel="stylesheet" type="text/css" href="css/reset.css" media="screen" title="html5doctor.com Reset Stylesheet" />
    
    <link rel="stylesheet" href="css/default.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" media="screen" />
    
    <!-- in the CSS3 stylesheet you will find examples of some great new features CSS has to offer -->
    <link rel="stylesheet" type="text/css" href="css/css3.css" media="screen" />
    
    <!-- general stylesheet contains some default styles, you do not need this, but it helps you keep a uniform style -->
    <link rel="stylesheet" type="text/css" href="css/general.css" media="screen" />
    
    <!-- grid's will help you keep your website appealing to your users, view 52framework.com website for documentation -->
    <link rel="stylesheet" type="text/css" href="css/grid.css" media="screen" />
    </head>
<body>
	
	
    
    <?php get_header('login','public'); ?>
    
  
	 
	<section class="row">    
    <p class="legend">Customer Identification</p>
    <?php 
		if(isset($_GET['action'])){
			$action = $_GET['action'];
			if($action == 'regExist'){ ?>		
                <div class="alert col_9 alert-block box-align-center marginb-30">
                    <button type="button" class="close" data-dismiss="alert">×</button>
                    <h4>Identification Error</h4>
                        This user already exist, please check the number.
                </div>
             <?php }
			 else if($action == 'regNotExist'){ ?>
             	<div class="alert col_9 alert-block box-align-center marginb-30">
                    <button type="button" class="close" data-dismiss="alert">×</button>
                    <h4>Identification Error</h4>
                        This user does not exist, please check the number.
                </div>
             <?php } } ?> 
			 
    <!-- start customerIdBox -->
     <div class="rounded customerIdBox col_9 box_shadow box-align-center">
     	 <ul class="nav nav-tabs" id="myTab">
          <li class="active"><a href="#existing">Existing Customer</a></li>
          <li><a href="#new">New Customer</a></li>          
        </ul>
        <!-- start tab-content -->
        <div class="tab-content">
          <!-- start tab-pane: existing -->
          <div class="tab-pane active" id="existing">
          	<h4>Existing Customer</h4>
            <p><i>Please enter existing customer's Number</i></p>
            <form id="checkCustomerExist" action="checkCustomer.php" method="post">
            	<input type="hidden" name="checktype" value="existing">
                <fieldset>
                	<div class="formElemWrap">
                    	<div class="formLabel left">
                        	<label>Customer Number</label>
                        </div>
                        <div class="formInput left">
                        	<?php getCustomerOptions(); ?>
                        	<!-- <input type="text" id="eNumb" name="eNumb" placeholder="Type in Customer Number"> -->
                        </div>
                        <div class="clear"></div>
                    </div>
                     <div class="formElemWrap">
                    	<div class="formLabel left">
                        	&nbsp;
                        </div>
                        <div class="formInput left">
                        	<button class="btn" type="reset">Reset</button>
                        	<button class="btn" type="submit">Send</button>                             
                        </div>
                        <div class="clear"></div>
                    </div>
                </fieldset>
            </form>
          </div>
          <!-- end tab-pane: existing -->
          <!-- start tab-pane: new -->
          <div class="tab-pane" id="new">
          	<h4>New Customer</h4>
            <p><i>Please fill the form</i></p>
            <form action="checkCustomer.php" method="post">
            	<input type="hidden" name="checktype" value="new">
            	<fieldset>
                	<div class="formElemWrap">
                    	<div class="formLabel left">
                        	<label>Full Name</label>
                        </div>
                        <div class="formInput left">
                        	<input type="text" id="nName" name="nName" placeholder="Customer's Full Name">
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formElemWrap">
                    	<div class="formLabel left">
                        	<label>Job Title</label>
                        </div>
                        <div class="formInput left">
                        	<input type="text" id="nJobTitle" name="nJobTitle" placeholder="Customer's Job Position">
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formElemWrap">
                    	<div class="formLabel left">
                        	<label>Location</label>
                        </div>
                        <div class="formInput left">
                        	<input type="text" id="nLocation" name="nLocation" placeholder="Customer's Location">
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formElemWrap">
                    	<div class="formLabel left">
                        	<label>P.O Box</label>
                        </div>
                        <div class="formInput left">
                        	<input type="text" id="nPO" name="nPO" placeholder="Customer's P.O Box">
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formElemWrap">
                    	<div class="formLabel left">
                        	<label>Email</label>
                        </div>
                        <div class="formInput left">
                        	<input type="text" id="nEmail" name="nEmail" placeholder="Customer's Email">
                        </div>
                        <div class="clear"></div>
                    </div>
                     <div class="formElemWrap">
                    	<div class="formLabel left">
                        	<label>Cellphone Number</label>
                        </div>
                        <div class="formInput left">
                        	<input type="text" id="nNumb" name="nNumb" placeholder="Customer Number">
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formElemWrap">
                    	<div class="formLabel left">
                        	<label>Company Name</label>
                        </div>
                        <div class="formInput left">
                        	<input type="text" id="nCompany" name="nCompany" placeholder="Company Name">
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formElemWrap">
                    	<div class="formLabel left">
                        	<label>Mobile Number</label>
                        </div>
                        <div class="formInput left">
                        	<input type="text" id="nMobile" name="nMobile" placeholder="Customer's Mobile Number">
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formElemWrap">
                    	<div class="formLabel left">
                        	&nbsp;
                        </div>
                        <div class="formInput left">
                        	<button class="btn" type="reset">Reset</button>
                        	<button class="btn" type="submit">Send</button>                             
                        </div>
                        <div class="clear"></div>
                    </div>
                </fieldset>
            </form>
          </div>
          <!-- end tab-pane: new -->         
        </div>
        <!-- end tab-content -->
     </div>
     <!-- end customerIdBox -->
    	<div class="clear"></div>
    </section>
    <footer class="row">

		<div class="col_16 col">all rights reserved &copy; <a href="#">LEDLAMPS</a> | </div>

	</footer>
	 
    <script src="js/bootstrap.min.js"></script>
    <script type="text/javascript">		
		 
	  $(document).ready(function(){		 
		$('#myTab a').click(function (e) {
				e.preventDefault();
				$(this).tab('show');
			});
	  });
   
    </script>
</body>
</html>